#define _CRT_SECURE_NO_WARNING
#include<iostream>
using namespace std;


class Person
{
public:
	Person(const char* name = "zss")
		:_name(name)
	{
		cout << "Person()" << endl;
	}

	Person(const Person& p)
		:_name(p._name)
	{
		cout << "Person(const Person& p)" << endl;
	}

	Person& operator=(const Person& p)
	{
		cout << "operator=" << endl;
		if (this != &p)
		{
			_name = p._name;
		}
		return *this;
	}

	~Person()
	{
		cout << "~Person" << endl;
	}

	
private:
	string _name;
};

class Student :public Person
{
public:
	Student(const char* s,int num)
		:Person(s)
		,_num(num)
	{}
	Student(const Student& s)
		:Person(s)
		,_num(s._num)
	{

	}
	Student& operator=(const Student& s)
	{
		if (this != &s)
		{
			Person::operator=(s);
			_num = s._num;
		}
		return *this;
	}
	~Student()
	{

	}
private:
	int _num = 1;
};
int main()
{
	Student s1("zss", 18);
	Student s2(s1);
	Student s3("ss", 17);
	s1 = s3;
	return 0;
}